package com.qingcheng.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.qingcheng.service.goods.SkuService;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;

@RestController
@RequestMapping("/sku")
@CrossOrigin
public class SkuController {
    @Reference
    private SkuService skuService;
    @RequestMapping("/findprice")
    @ResponseBody
    public Integer price(String skuId){
        Integer price=skuService.findPrice(skuId);
        return price;
    }
    @RequestMapping("/importAll")
    @ResponseBody
    public boolean importAll(){
        boolean result = false;
        try {
            result = skuService.importAll();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return result;
    }

}
